package cn.redragon.soa.common.exception;

import lombok.Getter;

@Getter
public enum SystemError implements BaseError {
    INPUT_CONVERT_ERROR("System_1", "Input parameter cannot be converted."),
    ACCESS_DENIED("System_2", "Access Denied."),
    NOT_FOUND("System_3", "[{0}] not exists with [{1}] . "),
    SYSTEM_INTERNAL_ERROR("System_4", "System internal error."),
    INVALID_PARAM_ERROR("System_5", "[{0}] {1}"),
    REMOTE_REST_ERROR("System_6", "Call remote server {0} error."),
    FILE_UPLOAD_ERROR("System_7", "File {0} upload error."),
    DATASOURCE_ROUTING_ERROR("System_8", "Method {0} is not allowed to use master datasource."),
    JSON_SERIALIZE_ERROR("System_9", "Parse an object to json string error."),
    JSON_DESERIALIZE_ERROR("System_10", "Parse json string to object error.");


    private final String code;

    private final String message;

    SystemError(String code, String message) {
        this.code = code;
        this.message = message;
    }

}
